package com.fc.mall.controller;

import com.fc.mall.decoration.link.object.LinkType;
import com.fc.mall.decoration.store.ShopInfo;
import com.fc.mall.dto.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@Api(tags = "DmsDecorationController", description = "店铺装修")
@RequestMapping("/admin/decoration")
public class DmsDecorationController {
    @ApiOperation("获取指定店铺信息")
    @RequestMapping(value = "/shop/{id}", method = RequestMethod.GET)
    @ResponseBody
    public Object getShopInfo(@PathVariable Long id) {
        ShopInfo shopInfo = new ShopInfo();
        shopInfo.setShopContent("bar");
        shopInfo.setShopName("My Demo Shop");
        return new CommonResult().success(shopInfo);
    }

    @ApiOperation("获取链接列表")
    @RequestMapping(value = "/linktypes", method = RequestMethod.GET)
    @ResponseBody
    public Object getLinkType() {
        List<LinkType> linkTypes = new ArrayList<>();
        linkTypes.add(new LinkType(){{setId("1");setName("产品");}});
        linkTypes.add(new LinkType(){{setId("2");setName("产品类型");}});
//        linkTypes.add(new LinkType(){{setId("3");setName("拼团活动");}});
        return new CommonResult().success(linkTypes);
    }
}
